import Branch from './treeBranch.js';
var Leaf = function (p, r, c, ctx) {
	this.p = p || null;

	this.r = r || 0;

	this.c = c || 'rgba(255,255,255,1.0)';

	this.ctx = ctx;
};

Leaf.prototype = {
	render: function () {
		var that = this;

		var ctx = this.ctx;

		var f = Branch.random(1, 2);

		for (var i = 0; i < 5; i++) {
			(function (r) {
				setTimeout(function () {
					ctx.beginPath();

					ctx.fillStyle = that.color;

					ctx.moveTo(that.p.x, that.p.y);

					ctx.arc(that.p.x, that.p.y, r, 0, Branch.circle, true);

					ctx.fill();
				}, r * 60);
			})(i);
		}
	},
};

export default Leaf;
